TreeGrid Gantt Chart Tutorial
11. Run groups and API
Manipulating Run box groups by actions and API
-
It is possible in GanttRun to assign to some or all boxes their identification - Group and Id.
The Id should be unique identification at least inside one group.
The Group identifies more boxes and is possible to manipulate all the boxes in the same group together.
-
If the boxes have set their Id attribute and is set also
GanttRunStates
='1', the grid fills for every changed box its state: Added, Deleted, Moved, Resized, Changed to identify the changed boxes in uploaded data.
Also for every box change is called API event OnGanttRunBoxChanged.
-
GanttRunGroupHover
attribute controls which boxes in the same group as the box under mouse cursor will be highlighted on mouse hover.
0 - none, 1 - only in the same row, 2 - all boxes in grid (can be slow for large grids).
Actions
for boxes and groups (except dragging, see previous tutorial)
-
There are actions to
delete
the box under mouse cursor (DeleteGanttRun), to delete all boxes in the group in the same row (DeleteGanttRunGroup)
and to delete all boxes in group (DeleteGanttRunGroupAll).
These actions can be attached to TreeGrid events and are accessible also from Gantt right click popup menu.
-
There are actions to
change
box type - to choose the type, class and other properties from list predefined in GanttRunTypes
list.
The actions are for one box (ChooseGanttRunType), for all boxes in group in the same row (ChooseGanttRunGroupType)
and for all boxes in group (ChooseGanttRunGroupAllType).
These actions can be attached to TreeGrid events and are accessible also from Gantt right click popup menu.
-
The other actions are only for the one active box, not for groups: EditGanttRun to enter the box text and EditGanttRunTip to enter the box tip.
API
for boxes
-
GetGanttRunBox to get one box from run by its index or Id and Group. Returns fully filled run box object.
-
SetGanttRunBox to modify one box in run.
-
AddGanttRunBox to create new box and insert it to run to given position.
-
DelGanttRunBox to delete given box from run.
-
ScrollToGanttRunBox to show the box in chart.
-
GetGanttRunBoxTag to get DOM object of the box to modify its look, but not position or size.
-
FindGanttRunBoxes
as complex searching function to get one or more boxes according to given parameters.
It can search in one or more box attribute Id, Group, Type, Text, Class, Tip. It can search exact string or just part of it.
Can search case insensitive and has many other options.